<CFIF ISDEFINED("FORM.btnBackAction")>
	<CFLOCATION url="#client.domain#eworksched/">
</CFIF>
<CFMODULE TEMPLATE = "#client.common_path#cfm_checkuserrecords.cfm" USERTABLE = "EGRGUSERAPPS"
	USERFIELD = "USERGRPID_FK" RECORDFIELD = "APPCODE_FK" USERTABLEDSN="#client.global_dsn#" RECORDID="EWSMANAGER">
<CFMODULE TEMPLATE="#client.common_path#cfm_geturlvariables.cfm" INCLUDEURL="type">

<CFIF urlVariables NEQ "">
	<CFSET urlVariables2 = "&" & urlVariables>
	<CFSET urlVariables = "?" & urlVariables>
<CFELSE>
	<CFSET urlVariables = "">
	<CFSET urlVariables2 = "">
</CFIF>

<CFIF ListLen(userRecords) EQ 0>
	<CFSET sModule ="worksched">
	<CFSET sTitle ="iBOS/e eWorkSked">
	<CFLOCATION url="#client.common_path#cfm_norights.cfm">
</CFIF>
<CFSET nameType = "eWorkSked">
<CFSET nameTitle = "iBOS/e eWorkSked Set-up">
<CFIF isdefined("url.powermast")>
	<CFSET nameTitle = "iBOS/e eWorkSked Power User">
</CFIF>

<CFSET nameModule = "worksched">
<CFSET nameLocation = "../">
<CFPARAM NAME="sMess" DEFAULT= "">
<CFPARAM NAME="sWarn" DEFAULT= "">
<CFMODULE TEMPLATE="#client.common_path#cfm_DBdateFormat.cfm">
<CFSET sDateNow = dateResult>
<!--- add old file - copy function --->
<CFIF isDefined("Form.btnAction") OR isDefined("url.delete")>
	<CFINCLUDE TEMPLATE="ws_action.cfm">
<CFELSEIF ISDEFINED("FORM.btnDeleteEmployee")>
	<CFIF ISDEFINED("FORM.chkPID") AND FORM.chkPID NEQ "">
		<CFLOOP LIST="#FORM.chkPID#" INDEX="USER">
			<CFQUERY NAME="DELETEUser" DATASOURCE="#client.company_dsn#">
				DELETE FROM CINWSPOWERUSER 
				WHERE PERSONNELIDNO = '#USER#'
			</CFQUERY>
		</CFLOOP>
		
		<CFSET sMess="Power User successfully removed.">
	<CFELSE>
		<CFSET sWarn="No employee to delete.<br>Select first an employee to be deleted.">
	</CFIF>
</CFIF>
<CFIF ISDEFINED("FORM.btnUserFilterSave")>
	<CFINCLUDE TEMPLATE="../common/_userfiltersavecondition.cfm">
</CFIF>
<SCRIPT LANGUAGE="JavaScript">
	<!--
	function confirmThis(message) {
		if(confirm(message)) return true;
			return false;
	}
	-->
</SCRIPT>
<CFINCLUDE TEMPLATE="#client.common_path#_toggle.cfm">

<HTML>
	<HEAD>
		<TITLE>iBOS/e WebShell - eWorkSked</TITLE>
		<CFOUTPUT>
			<LINK REL="StyleSheet" HREF="#client.wstheme_path##client.empcolor#.css" TYPE="text/css">
		</CFOUTPUT>
	</HEAD>


	<BODY TOPMARGIN=0 RIGHTMARGIN=0 LEFTMARGIN=0>
		<CFMODULE TEMPLATE="#client.common_path#cfm_workspace.cfm" COMPONENT="#nameTitle# Manager" MODULE="utilities" LOCATION="../../webshell/">
		<CFSET client.isPowerUser=false>
		<CFIF sMess NEQ "">
			<CFOUTPUT>
				<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TITLE="Information">
				<BR><B>#sMess#</B><BR>
				<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TOP="False">
			</CFOUTPUT>
		</CFIF>
		<CFIF sWarn NEQ "">
			<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TITLE="There was a problem!">
				<CFOUTPUT>
					<BR><FONT COLOR="##FF0000"><B>#sWarn#</B></FONT><BR>
						<A HREF="javascript:history.back()">Back to Previous Screen</A>
					</CFOUTPUT>
			<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TOP="False">
		<CFELSE>
			<!--- everything's under control --->
			<CFSET sAppType = nameModule>
			<CFIF isdefined("url.powermast")>
				<CFIF isDefined("FORM.btnAddEmployee") OR ISDEFINED("FORM.REFRESH")>
					<CFINCLUDE TEMPLATE="addppoweruser.cfm">
				<CFELSEIF ISDEFINED("FORM.btnfilter") OR (ISDEFINED("URL.ACTION") AND URL.ACTION EQ "EDITFILTER")>
					<CFSET sTypeID='powerWSUser'>
					<CFSET sTypeIDEnc = urlencodedformat(encrypt(sTypeID, client.ek))>
					<CFINCLUDE TEMPLATE="masteruser.cfm">
				<CFELSE>
					<CFINCLUDE TEMPLATE="masteruser.cfm">
				</CFIF>
			<CFELSEIF (isDefined("Form.btnAddWS") OR IsDefined("url.edit") OR IsDefined("url.replicate")) AND NOT ISDEFINED("FORM.btnBackMgr") AND NOT ISDEFINED("Form.btnAction")>
				<CFINCLUDE TEMPLATE="_details.cfm">
			<CFELSE>
				<CFINCLUDE TEMPLATE="_browse.cfm">
			</CFIF>
		</CFIF>
		<CFMODULE TEMPLATE="#client.common_path#cfm_workspace.cfm" TOP="False">
	</BODY>
</HTML>

